package clientresponse;

import android.util.Log;
import clientcore.AndroidMain;
import clientcore.Message;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;

public class ResponseUpdateBuddyInvites extends ResponseFromServer {
	private static final String TAG = ResponseUpdateBuddyInvites.class.getSimpleName();

    public static Vector<Message> buddyInvites=null;

    @Override
    public short process() {
 	   
    	if(buddyInvites==null)
    		buddyInvites = new Vector<Message>();
    	Message m;
    	
        /*Protocol:
         * (int) numResults, [(String) charName, (String) message]*
         */
    	int numResults = super.readInt(inFromServer);
	    for(int i=0; i<numResults; i++) {
	    	m = new Message();
	        m.setSender(super.readString(inFromServer));
	        m.setText(super.readString(inFromServer));
	        buddyInvites.add(m);
	    }
	        return -2;
    }
}
